<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>项目里程碑设置</title>
    <link rel="stylesheet" href="${re.contextPath}/plugin/layui/css/layui.css" media="all"/>
    <!--公用样式-->
    <link rel="stylesheet" href="${re.contextPath}/plugin/common/css/comment.css">
    <!--页面样式-->
    <link rel="stylesheet" href="${re.contextPath}/plugin/common/css/style.css">
    <link rel="stylesheet" href="${re.contextPath}/plugin/common/css/extended.css">
    <script type="text/javascript" src="${re.contextPath}/plugin/layui/layui.all.js"></script>
    <script type="text/javascript" src="${re.contextPath}/plugin/jquery/jquery-3.2.1.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="${re.contextPath}/plugin/common/js/comment.js"></script>
</head>
<body class="whitebg">
<div class="myDataCentere mydataCentere-small" style="height: 340px">
    <ul>
        <li>
            <label class="layui-form-label">添加里程</label>
            <select name="LCList" id="LCList">
                <option selected hidden disabled value="">点击选择里程</option>
                <#list LCList as vo>
                    <option value="${vo.badtCode}">${vo.badtName}</option>
                </#list>
            </select>
            <input type="hidden" name="id" id="id" value="${stage.id}">
        </li>
        <li>
            <label class="layui-form-label">排列顺序</label>
            <input id="milepost_order_num_input" type="number" placeholder="请输入阶段顺序" min="1" value="1" step="1" autocomplete="off">
        </li>
<#--        <li>-->
<#--            <label class="layui-form-label">英文简称</label>-->
<#--            <input id="milepost_enjc" type="text" placeholder="请输入英文简称" autocomplete="off">-->
<#--        </li>-->
        <li>
            <label class="layui-form-label">里程碑占比</label>
            <input id="milepost_zb" type="number" placeholder="请输入里程碑占比" min="1" value="1" step="0.01" autocomplete="off">
        </li>
    </ul>
</div>

<div style="background-color: white;background-color: white;padding: 15px;text-align: center;position: fixed;bottom: 1px;width: 100%;">
    <button class="layui-btn layui-btn-sm" lay-filter="submitStage" lay-submit type="button">添加</button>
    <button class="layui-btn layui-btn-primary layui-btn-sm" type="button" id="close">取消</button>
</div>

<script type="text/javascript" src="${re.contextPath}/plugin/tools/tool.js"></script>
<script>
    layui.use(['form','layer'], function(){
        $ = layui.jquery;
        var form = layui.form
            ,layer = layui.layer;

        $('#close').click(function(){
            var index = parent.layer.getFrameIndex(window.name);
            parent.layer.close(index);
        });
        //监听提交

        form.on('submit(submitStage)', function(data){
            var milepostNo = $('#LCList').val();
            if(!milepostNo){
                layer.msg("请选择需要添加的里程");
                return ;
            }
            var id = localStorage.getItem("currentStageId");
            var orderNum = $('#milepost_order_num_input').val();
            var enjc = $("#milepost_enjc").val();
            var zb = $("#milepost_zb").val();
            var json = {
                milepostNo: milepostNo,
                stageId:id,
                orderNum: orderNum,
                milepostEnjc: enjc,
                milepostZb: zb
            }
            layerAjax('/adminManager/jc/milepostManagerJc/addMilepostValue',json, '',
                function (d) {
                    if (d.flag == true) {
                        layui.table.reload('milepostList');
                        layer.msg(d.msg, {icon: 1});
                        var index = parent.layer.getFrameIndex(window.name);
                        parent.layer.close(index);
                    } else {
                        layer.msg(d.msg, {icon: 2});
                    }
                });
            return false;
        });
    });
</script>
</body>
</html>